package com.heima.user.controller.v1;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.user.service.ApUserCenterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.util.Map;

/**
 * @author:Dikk
 * @create: 2023-08-04 15:27
 * @Description: UserCenterController
 */
@RestController
@RequestMapping("/api/v1/center")
public class UserCenterController {

    @Autowired
    private ApUserCenterService apUserCenterService;

    /**
     * 上传个人认证
     *
     * @param fontImage 身份证正面照片
     * @param backImage 身份证背面照片
     * @param holdImage 手持照片
     * @param liveImage 活体照片
     * @param userId    用户id
     * @param name      用户名
     * @param idno      身份证号
     * @return
     */
    @PostMapping("/upload")
    public ResponseResult uploadCertificate(
            @RequestParam MultipartFile fontImage,
            @RequestParam MultipartFile backImage,
            @RequestParam MultipartFile holdImage,
            @RequestParam MultipartFile liveImage,
            @RequestParam Integer userId,
            @RequestParam String name,
            @RequestParam String idno
    ) {
        return apUserCenterService.uploadCertificate(fontImage, backImage, holdImage, liveImage, userId, name, idno);
    }
}
